package com.mall.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mall.db.api.UmsResourceApi;
import com.mall.pojo.UmsResource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UmsResourceService {

    @DubboReference
    private UmsResourceApi umsResourceApi;


    //分页模糊查询后台资源
    public Page<UmsResource> list(Integer pageNum, Integer pageSize, Long categoryId, String nameKeyword, String urlKeyword) {
      return   umsResourceApi.list(pageNum,pageSize,categoryId,nameKeyword,urlKeyword);
    }

    //查询所有后台资源
    public List<UmsResource> listAll() {
        return umsResourceApi.listAll();
    }

    //添加后台资源
    public void create(UmsResource umsResource) {
        umsResourceApi.create(umsResource);
    }

    //根据ID删除后台资源
    public void delete(Long id) {
        umsResourceApi.delete(id);
    }

    //修改后台资源
    public void update(Long id, UmsResource umsResource) {
        umsResourceApi.update(id,umsResource);
    }

    //根据ID获取资源详情
    public UmsResource selectById(Long id) {
        return umsResourceApi.selectById(id);
    }
}
